package com.quick.service;

import com.quick.domain.Permission;
import com.quick.domain.Role;
import com.quick.domain.User;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;

/**
 * @author jojo.wang
 * @title: UserService
 * @projectName spring-boot-quick
 * @description: TODO
 * @date 2019/5/611:23
 */
@Service
public class UserService {
    public User findByName(String name){
        User user = new User();
        user.setUname(name);
        user.setNick(name+"NICK");
        //密码明文是123456
        user.setPwd("J/ms7qTJtqmysekuY8/v1TAS+VKqXdH5sB7ulXZOWho=");
        //加密密码的盐值
        user.setSalt("wxKYXuTPST5SG0jMQzVPsg==");
        //随机分配一个id
        user.setUid(new Random().nextLong());
        user.setCreated(new Date());
        return user;
    }
}
